<template>
  <div>
    <h2>双向绑定指令</h2>
    姓名: <input type="text" v-model.trim="form.uname" /> <br />
    年龄:<input type="text" v-model.number="form.age" /> <br />
    薪资: <input type="text" v-model.lazy="form.salary" /> <br />
    <button @click="aa">确认添加</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        uname: "",
        age: "",
        salary: "",
      },
    };
  },
  methods: {
    aa() {
      this.form;
      console.log("你提交的数据是", this.form);
    },
  },
};
</script>

<style>
.box {
  width: 200px;
  height: 1px;
  background-color: green;
}
</style>